package cn.edu.nchu.fragmentdemo.db.dao;
import android.content.Context;

import cn.edu.nchu.fragmentdemo.bean.RouteTask;
import cn.edu.nchu.fragmentdemo.db.helper.ORMLiteHelper;

/**
 * RouteTask实体类的数据访问对象（DAO）。
 *
 * @author Tsuki
 */
import com.j256.ormlite.dao.Dao;

import java.sql.SQLException;

public class RouteTaskDao  {

    private static Dao<RouteTask, Integer> RouteTask;

    public static Dao<RouteTask, Integer> getRouteTaskDao(Context context) {
        if (RouteTask == null) {
            synchronized (RouteTaskDao.class) {
                if (RouteTask == null) {
                    try {
                        RouteTask = (Dao) ORMLiteHelper.getInstance(context).getDao(RouteTask.class);
                    } catch (SQLException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                }
            }
        }
        return RouteTask;
    }

}


